package nero.yncc.com.createart.custom;

import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.ListView;

/**
 * Created by Administrator.
 * Time:2017/3/10 09:54.
 * 用于嵌套到scrollView中，防止和scrollView滑动冲突
 */

public class NoTouchListView extends ListView {
    public NoTouchListView(Context context) {
        super(context);
        init();
    }

    public NoTouchListView(Context context, AttributeSet attrs) {
        super(context, attrs);
        init();
    }

    public NoTouchListView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        init();
    }

    private void init() {

    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        // TODO Auto-generated method stub
        int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,
                MeasureSpec.AT_MOST);
        super.onMeasure(widthMeasureSpec, expandSpec);
    }

    @Override
    public boolean onInterceptTouchEvent(MotionEvent ev) {
        return false;
    }

}
